﻿<UserControl x:Class="SilverDesigner.ToolboxMenu"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="800" d:DesignWidth="50">
    <UserControl.Resources>
        <Style x:Key="ToggleButtonStyle1" TargetType="ToggleButton">
            <Setter Property="Margin" Value="3" />
            <Setter Property="Width" Value="40" />
            <Setter Property="Height" Value="40" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton">
                        <Border x:Name="border" Background="Transparent" BorderThickness="1">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver"/>
                                        <VisualTransition GeneratedDuration="0:0:0.1" To="Normal"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FF797979" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed"/>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.1" To="Checked"/>
                                        <VisualTransition GeneratedDuration="0:0:0.1" To="Unchecked"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Checked">

                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush)" Storyboard.TargetName="border">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="White"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>

                                    </VisualState>
                                    <VisualState x:Name="Unchecked"/>
                                    <VisualState x:Name="Indeterminate"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border Background="{TemplateBinding Background}" Margin="5"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <StackPanel x:Name="LayoutRoot" Background="#FF444444" Orientation="Vertical">
        <RadioButton x:Name="btnHand" Style="{StaticResource ToggleButtonStyle1}" GroupName="toolG1" Checked="btnHand_Checked">
            <ToggleButton.Background>
                <ImageBrush ImageSource="Images/Very-Basic-Hand-cursor-icon.png" Stretch="Fill" />
            </ToggleButton.Background>
        </RadioButton>
        <RadioButton x:Name="btnBlackArrow" Style="{StaticResource ToggleButtonStyle1}" GroupName="toolG1" Checked="btnBlackArrow_Checked">
            <ToggleButton.Background>
                <ImageBrush ImageSource="Images/Arrow-icon_black.png" Stretch="Fill" />
            </ToggleButton.Background>
        </RadioButton>
        <RadioButton x:Name="btnWhiteArrow" Style="{StaticResource ToggleButtonStyle1}" GroupName="toolG1" Checked="btnWhiteArrow_Checked">
            <ToggleButton.Background>
                <ImageBrush ImageSource="Images/Arrow-icon_white.png" Stretch="Fill" />
            </ToggleButton.Background>
        </RadioButton>
        <Border HorizontalAlignment="Stretch" Height="2" Background="Silver" />
        <RadioButton x:Name="btnContainer" Style="{StaticResource ToggleButtonStyle1}" GroupName="toolG1" Checked="btnContainer_Checked">
            <ToggleButton.Background>
                <ImageBrush ImageSource="Images/Actions-select-rectangular-icon.png" Stretch="Fill" />
            </ToggleButton.Background>
        </RadioButton>
        <RadioButton x:Name="btnImage" Style="{StaticResource ToggleButtonStyle1}" GroupName="toolG1" Checked="btnImage_Checked">
            <ToggleButton.Background>
                <ImageBrush ImageSource="Images/image-icon.png" Stretch="Fill" />
            </ToggleButton.Background>
        </RadioButton>
        <RadioButton x:Name="btnVideo" Style="{StaticResource ToggleButtonStyle1}" GroupName="toolG1" Checked="btnVideo_Checked">
            <ToggleButton.Background>
                <ImageBrush ImageSource="Images/movies-icon.png" Stretch="Fill" />
            </ToggleButton.Background>
        </RadioButton>
        <RadioButton x:Name="btnText" Style="{StaticResource ToggleButtonStyle1}" GroupName="toolG1" Checked="btnText_Checked">
            <ToggleButton.Background>
                <ImageBrush ImageSource="Images/text-richtext-icon.png" Stretch="Fill" />
            </ToggleButton.Background>
        </RadioButton>
        <Border HorizontalAlignment="Stretch" Height="2" Background="Silver" />
    </StackPanel>
</UserControl>
